package com.coder4j.log.service.impl;

import com.coder4j.log.entity.ErrorLogEntity;
import com.coder4j.log.mapper.ErrorLogMapper;
import com.coder4j.log.vo.ErrorLogQuery;
import com.coder4j.log.vo.ErrorLogVO;
import com.coder4j.log.service.IErrorLogService;
import com.coder4j.starter.web.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.BeanUtils;

import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;

/**
 * 系统错误日志
 * @author keller
 * @date 2024-05-07 18:18:57
 */
@Service
@Slf4j
public class ErrorLogServiceImpl extends BaseServiceImpl<ErrorLogMapper,ErrorLogEntity,ErrorLogVO> implements IErrorLogService{

    @Resource
    private ErrorLogMapper mapper;

    @Override
    public ErrorLogVO entity2Vo(ErrorLogEntity entity) {
        ErrorLogVO vo = new ErrorLogVO();
        BeanUtils.copyProperties(entity,vo);
        return vo;
    }

    @Override
    public ErrorLogEntity vo2Entity(ErrorLogVO vo) {
        ErrorLogEntity entity = new ErrorLogEntity();
        BeanUtils.copyProperties(vo, entity);
        return entity;
    }
}
